#!/bin/bash

EnableQSD8X50Build=0
EnableMSM8X60Build=0

source $HOME/.pathenv

if [ ! -d $HOME/work ]; then
  exit 1;
fi

pushd $HOME/work > /dev/null 2>&1 

log_file=schedule-build.log

# Generate crontabsh.sh run log
echo >> $log_file
echo -n :: Run crontabsh.sh at ->>$log_file
date >>$log_file
echo SHELL=$SHELL >> $log_file
echo PATH=$PATH >> $log_file
echo HOME=$HOME >> $log_file

# Command
if [ "$EnableQSD8X50Build" == "1" ]; then
  if [ $(date +%d) -eq 1 ]; then
    echo ./QSD8X50-Android/buildall.sh -b EVT1C -svn -android clean -amss clean >> $log_file

    ./QSD8X50-Android/buildall.sh -b EVT1C -svn -android clean -amss clean
  fi
fi

# MSM8X60-Android daily build
if [ "$EnableMSM8X60Build" == "1" ]; then
  pushd ./MSM8X60-Android/
    svn up
    pushd ./LINUX/android/
     ./buildit.sh
    popd
  popd
fi

popd > /dev/null 2>&1
